// utils/config.js

import { getMiniAppEnv } from './env'

const ENV = 'release' || getMiniAppEnv() // 'develop' | 'trial' | 'release'

const BASE_URL_MAP = {
  develop: 'http://192.168.1.54:8007/',                  // 本地开发版
  trial:   'https://ctrl.mall.senda360.com/',           // 体验版
  release: 'https://ctrl.mall.senda360.com/',                // 正式版
}

const WS_HEARTBEAT_URL_MAP = {
  develop: 'ws://192.168.1.54:8007/ws/',         // 注意：本地用 ws://，不加 s
  trial:   'wss://dev.mall.senda360.com/ws/',
  release: 'wss://mall.senda360.com/ws/',
}

const BASE_URL = BASE_URL_MAP[ENV]
const WS_HEARTBEAT_URL = WS_HEARTBEAT_URL_MAP[ENV]

export {
  ENV,
  BASE_URL,
  WS_HEARTBEAT_URL,
}

